package com.listener;

/**
 * @ClassName: ListenerDemoTest
 * @Description:
 * @Author Fly
 * @Date 2022/12/19 11:45
 */
public class ListenerDemoTest {


    public static void main(String[] args) {

        Editor editor = new Editor();
        editor.events.subscribe("open", new LogOpenListener("C:\\Users\\HP\\Desktop\\对账.txt"));
        editor.events.subscribe("save", new EmailNotificationListener("admin@example.com"));

        try {
            editor.openFile("test.txt");
            editor.saveFile();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
